<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取元素内容</title>
</head>
<body>
    <div id="d1">
        你好，JavaScript
    </div>
<hr>
<button onclick="demo01()">改变文本内容</button>

</body>
<script>

    function demo01() {
        //获取到整个元素对象
        var obj = document.getElementById("d1")
        //obj.innerHTML = "Hello Python"
        // console.log(obj.innerText)
        obj.innerText = "Hello Python"
    }
</script>
</html>